<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    var defaults = {
        options: {
            remove: true,
            enable: false,
            instance: {}
        },
        log: {
            warn: true,
            error: true
        }
    }

    var config = {
        options: {
            remove: false,
            instance: null
        }
    }

    config.options = config.options || {};
    config.log = config.log || {};
    // 没有var a那么就是当做语句执行，会报错，这个必须得有
    // 然后这个就相当于正常赋值了，先解构赋值，然后通过赋值链来把config的对象绑定给a,
    var a = {
        options: {
            remove: config.options.remove = defaults.options.remove,
            enable: config.options.enable = defaults.options.enable,
            instance: config.options.instance = defaults.options.instance
        } = {},
        log: {
            warn: config.log.warn = defaults.log.warn,
            error: config.log.error = defaults.log.error
        } = {}
    } = config

</script>

</html>